package stours

import (
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
	"order-form/hars"
)

func Init() *gin.Engine {
	r := gin.Default()
	r.Static("/static", "./static")
	r.Use(cors.Default())
	r.POST("login", hars.Login)
	r.POST("rolenode", hars.RoleNode)
	r.GET("userrole", hars.UserRole)
	r.POST("addorder", hars.AddOrder)
	r.GET("noderole", hars.NodeRole)
	r.GET("orderlist", hars.OrderList)
	r.GET("RepoLimit", hars.RepoLimit)
	r.GET("list", hars.List)
	return r
}
